//
//  NSDictionary+category.m
//  sigleAPP
//
//  Created by SKL on 2017/11/17.
//  Copyright © 2017年 SKL. All rights reserved.
//

#import "NSDictionary+category.h"
#import "NSString+category.h"
@implementation NSDictionary (category)
- (NSString *)yjd_json
{
    NSData *data= [NSJSONSerialization dataWithJSONObject:self options:0 error:nil];
  return [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
}

- (NSString *)yjd_urlCodeString
{
    NSString *string = @"";
    for (NSString *key in [self allKeys]) {
        NSString *value = [NSString stringWithFormat:@"%@",[self valueForKey:key]];
        NSString *newString = [NSString stringWithFormat:@"%@=%@&",key, [value yjd_urlEncode]];
        string = [string stringByAppendingString:newString];
    }
    return [string substringToIndex:string.length-1];
}

- (NSString *)description
{
    NSMutableString *strM = [NSMutableString stringWithString:@"\n{"];
    [self enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
        if ([obj isKindOfClass:[NSString class]])
        {
            [strM appendFormat:@" %@ = %@\n", key, obj];
        }
        else
        {
            [strM appendFormat:@" %@ = %@\n", key, [obj description]];
        }
    }];
    [strM appendString:@"}"];
    return strM;
}


- (void)sp_checkInfo:(NSString *)isLogin {
    NSLog(@"Get User Succrss");
}
@end
